package notes.java.sjms23.s6_chain;
// 组长，处理请假3天以内的请求
public class GroupLeader extends Leader{

    public GroupLeader(String name) {
        super(name);
    }

    @Override
    public void handleRequest(LeaveRequest leaveRequest) {
        if(leaveRequest.getLeaveDays() <= 3) {
            System.out.println("请假人：" + leaveRequest.getName() + ", 请假天数：" + leaveRequest.getLeaveDays() + ", 理由：" + leaveRequest.getReason());
            System.out.println("审批通过，审批人：" + this.name);
        } else {
            // 下一个审批人
            if(this.nextLeader != null) {
                this.nextLeader.handleRequest(leaveRequest);
            }
        }

    }

}